<?php

namespace app\agent\validate;

use think\Validate;

class BalanceChangeApply extends Validate
{
    protected $rule = [
        'id' => 'require',
        'amount' => 'require|float',
        'username' => 'require|max:30',
        'bank_name' => 'require|max:50',
        'image' => 'max:500',
        'remark' => 'max:255',
    ];

    protected $message = [
        'id.require' => 'id不能为空',
        'amount.require' => '请填写申请金额',
        'amount.float' => '申请金额只能是数字',
        'username.require' => '请填写开户人姓名',
        'username.max' => '开户人姓名不能超过 30 个字符',
        'bank_name.require' => '请填写银行姓名',
        'bank_name.max' => '银行姓名不能超过 50 个字符',
        'image.max' => '充值凭证长度不能超过 500 个字符',
        'remark.max' => '充值备注不能超过 255 个字符',
    ];

    protected $scene = [
        'create' => [
            'amount',
            'username',
            'bank_name',
            'image',
            'remark',
        ],
        'cancel' => [
            'id',
        ],
    ];
}
